home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
Dots & Pixels
/
sources
/
depthChange.cp
< prev
next >
Wrap
Text File
|
1995-09-29
|
524b
|
32 lines
#include <Palettes.h>
#include "depthChange.h"
depthChange::depthChange() : oldDepth( 0)
{
theGDHandle = 0;
}
depthChange::depthChange( int newDepth, GDHandle aGDHandle)
: oldDepth( (**(**aGDHandle).gdPMap).pixelSize)
{
if( newDepth == oldDepth)
{
theGDHandle = 0;
} else {
theGDHandle = aGDHandle;
}
if( SetDepth( aGDHandle, newDepth, 0x0001, 0x0001) != noErr)
{
theGDHandle = 0;
}
}
depthChange::~depthChange()
{
if( theGDHandle != 0)
{
(void)SetDepth( theGDHandle, oldDepth, 0x0001, 0x0001);
}
}